#include "featurematchertest.h"
#include "../featureextractor.h"
#include "../imageloader.h"

#include <cstdio>
#include <vector>
#include "../sift/kdtree.h"
#include "../sift/imgfeatures.h"
#include "../featurematcher.h"
#include "../imagefeature.h"
#include "../stitcher.h"
#include "../imageset.h"
#include <boost/foreach.hpp>
#include "../inputimage.h"

using namespace cshotel;
using namespace boost;
using namespace std;
using namespace sift;

void FeatureMatcherTest::setUp() {

}

void FeatureMatcherTest::tearDown() {

	delete imgloader;
	delete featureextractor;
	delete featurematcher;

}

void FeatureMatcherTest::testMatchSame() {

	int num, total = 25;
  imageNames.clear();
  for(num = 0; num < total; num++) {
      imageNames.push_back("../src/tests/images/0.jpg");
  }
  imgloader = new ImageLoader( imageNames );
  shared_ptr<ImageSet> imageSet = imgloader->loadImages();
  featureextractor = new FeatureExtractor(imageSet);
	featureextractor->extract();

	CPPUNIT_ASSERT_NO_THROW ( featurematcher = new FeatureMatcher(imageSet) );
	CPPUNIT_ASSERT_NO_THROW ( featurematcher->match(4) );

}
